return 1;
}
-/* Returns the *real* unscaled size, which may be a fractional size
- in surface scale coordinates. We need this to properly handle GL
- coordinates which are y-flipped in the real coordinates. */
-void
-gdk_surface_get_unscaled_size (GdkSurface *surface,
- int *unscaled_width,
- int *unscaled_height)
-{
- GdkSurfaceClass *class;
- int scale;
-
- g_return_if_fail (GDK_IS_SURFACE (surface));
-
- class = GDK_SURFACE_GET_CLASS (surface);
-
- if (class->get_unscaled_size)
- {
- class->get_unscaled_size (surface, unscaled_width, unscaled_height);
- return;
- }
-
- scale = gdk_surface_get_scale_factor (surface);
-
- if (unscaled_width)
- *unscaled_width = surface->width * scale;
-
- if (unscaled_height)
- *unscaled_height = surface->height * scale;
-}
-
-
/**
* gdk_surface_set_opaque_region:
* @surface: a top-level `GdkSurface`
double dy);
int (* get_scale_factor) (GdkSurface *surface);
- void (* get_unscaled_size) (GdkSurface *surface,
- int *unscaled_width,
- int *unscaled_height);
void (* set_opaque_region) (GdkSurface *surface,
cairo_region_t *region);
GError **error);
GdkGLContext * gdk_surface_get_shared_data_gl_context (GdkSurface *surface);
-void gdk_surface_get_unscaled_size (GdkSurface *surface,
- int *unscaled_width,
- int *unscaled_height);
gboolean gdk_surface_handle_event (GdkEvent *event);
GdkSeat * gdk_surface_get_seat_from_event (GdkSurface *surface,
GdkEvent *event);
surface->height = height;
impl->surface_scale = _gdk_win32_display_get_monitor_scale_factor (display_win32, NULL, NULL, NULL);
- impl->unscaled_width = width * impl->surface_scale;
- impl->unscaled_height = height * impl->surface_scale;
dwExStyle = 0;
owner = NULL;
{
int scale = impl->surface_scale;
- impl->unscaled_width = new_rect.right - new_rect.left;
- impl->unscaled_height = new_rect.bottom - new_rect.top;
-
impl->next_layout.configured_rect = new_rect;
- impl->next_layout.configured_width = (impl->unscaled_width + scale - 1) / scale;
- impl->next_layout.configured_height = (impl->unscaled_height + scale - 1) / scale;
+ impl->next_layout.configured_width = (new_rect.right - new_rect.left + scale - 1) / scale;
+ impl->next_layout.configured_height = (new_rect.bottom - new_rect.top + scale - 1) / scale;
}
context->native_move_resize_pending = TRUE;
}
}
-void
-_gdk_win32_surface_get_unscaled_size (GdkSurface *window,
- int *unscaled_width,
- int *unscaled_height)
-{
- GdkWin32Surface *impl = GDK_WIN32_SURFACE (window);
-
- if (unscaled_width)
- *unscaled_width = impl->unscaled_width;
- if (unscaled_height)
- *unscaled_height = impl->unscaled_height;
-}
-
static void
gdk_win32_surface_set_input_region (GdkSurface *window,
cairo_region_t *input_region)
{
_gdk_win32_get_window_rect (surface, &rect);
- impl->unscaled_width = rect.right - rect.left;
- impl->unscaled_height = rect.bottom - rect.top;
-
- impl->next_layout.configured_width = (impl->unscaled_width + scale - 1) / scale;
- impl->next_layout.configured_height = (impl->unscaled_height + scale - 1) / scale;
+ impl->next_layout.configured_width = (rect.right - rect.left + scale - 1) / scale;
+ impl->next_layout.configured_height = (rect.bottom - rect.top + scale - 1) / scale;
surface->x = rect.left / scale;
surface->y = rect.top / scale;
}
impl_class->drag_begin = _gdk_win32_surface_drag_begin;
impl_class->create_gl_context = _gdk_win32_surface_create_gl_context;
impl_class->get_scale_factor = _gdk_win32_surface_get_scale_factor;
- impl_class->get_unscaled_size = _gdk_win32_surface_get_unscaled_size;
impl_class->request_layout = _gdk_win32_surface_request_layout;
impl_class->compute_size = _gdk_win32_surface_compute_size;
}
}
}
-static void
-gdk_x11_surface_get_unscaled_size (GdkSurface *surface,
- int *unscaled_width,
- int *unscaled_height)
-{
- GdkX11Surface *impl = GDK_X11_SURFACE (surface);
-
- if (unscaled_width)
- *unscaled_width = impl->unscaled_width;
-
- if (unscaled_height)
- *unscaled_height = impl->unscaled_height;
-}
-
static void
update_shadow_size (GdkSurface *surface,
int shadow_left,
impl_class->get_scale_factor = gdk_x11_surface_get_scale_factor;
impl_class->set_opaque_region = gdk_x11_surface_set_opaque_region;
impl_class->create_gl_context = gdk_x11_surface_create_gl_context;
- impl_class->get_unscaled_size = gdk_x11_surface_get_unscaled_size;
impl_class->request_layout = gdk_x11_surface_request_layout;
impl_class->compute_size = gdk_x11_surface_compute_size;
}